package heild;
import java.util.Scanner;

public class TicTacToe {
	
	private char[][] board = new char[3][3];
	int currentPlayer;
	int plays;
	String player1 = "";
	String player2 = "";
	Boolean player1check = true;
	Boolean player2check = false;

	TicTacToe (String player1, String player2)
    {
        this.player1 = player1;
        this.player2 = player2;
    }
	
	
	  public String getPlayer1 ( )
      {
          return this.player1;
      }

      public void setPlayer1 (String player1)
      {
          this.player1 = player1;           
      }
      
      public String getPlayer2()
      {
    	  return this.player2;
      }
      
      public void setPlayer2()
      {
    	  this.player2 = player2;
      }
      
      

	public char[][] initialize(){

		int counter = 97;
		// We have 2 Users defined by a integer number 1 or 2
		int user = 1;
        for (int i = 0; i < 3; i++) {
            for (int j = 0; j < 3; j++) {
                board[i][j] =(char) counter;
                counter++;
            }
        }
        currentPlayer = 1;
        plays = 0;
        return board;
        
	}

	
	public void printBoard() {
		for (int i = 0; i < 3; i++) {
            for (int j = 0; j < 3; j++){
            		System.out.print(board[i][j]);
            		System.out.print("  ");
            	}
            System.out.println("\n");
            }
	}

			public void printWinner() {
		// TODO Auto-generated method 
	}


	public int readMove() 
	{
		printBoard();
		System.out.println("Welcome to TicTacToe");
		Boolean userInputCheck = false;
		int userMove = 0;
		do
		{
			System.out.println("Chose a number between 1-9");
			Scanner input = new Scanner( System.in ); 
			userMove = input.nextInt();
			
			if (userMove < 10 && userMove > 0)
			userInputCheck = true;
			else 
				System.out.println("Number Must be between 1-9 Chose again");
		
			if(boardgame[0][0] == 'X' or 'O')
			
	
		
		}
		while (userInputCheck == false); 
	
		return userMove;
	}

	public boolean isWinner() {
		// TODO Auto-generated method stub
		return false;
	}
	
	public void FillTicTacToe()
	{
	
		int userMove = readMove();
        
		
	}
	
	public char[][] GetUserMove
	{

		
		//		if(player1check == true)
//		{
//			switch (userMove) 
//			{
//            case 1:  board[0][0] = 'X';      break;
//            case 2:  board[0][1] = 'X';      break;
//            case 3:  board[0][2] = 'X';      break;
//            case 4:  board[1][0] = 'X';      break;
//            case 5:  board[1][1] = 'X';      break;
//            case 6:  board[1][2] = 'X';      break;
//            case 7:  board[2][0] = 'X';      break;
//            case 8:  board[2][1] = 'X';      break;
//            case 9:  board[2][2] = 'X';      break;
//			}
//		}	
//		
//		if(player2check == true)	
//		{
//			switch (userMove) 
//			{
//            case 1:  board[0][0] = 'O';       break;
//            case 2:  board[0][1] = 'O';      break;
//            case 3:  board[0][2] = 'O';      break;
//            case 4:  board[1][0] = 'O';      break;
//            case 5:  board[1][1] = 'O';      break;
//            case 6:  board[1][2] = 'O';      break;
//            case 7:  board[2][0] = 'O';      break;
//            case 8:  board[2][1] = 'O';      break;
//            case 9:  board[2][2] = 'O';      break;
//			}
//		}
	}
		public void StartGame()
		{
		
			for (int i = 0; i<9 i++)	
			{
				FillticTacToe();
				
					if(player1check == true)
				player1check = false;
					if(player2check == false)
						player2check = true;
			}
			
		}
	}

}
